home *** CD-ROM | disk | FTP | other *** search
/ Aminet 21 / Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso / Aminet / dev / misc / p96pcq.lha / Picasso96PCQ / Examples / ModeList.p < prev    next >
Encoding:
Text File  |  1997-07-18  |  1.9 KB  |  81 lines

  1. Program ModeList;
  2.  
  3. {
  4.     PCQ-Version des Picasso96-Demoprogrammes
  5.  
  6.     in Pascal übersetzt von Andreas Neumann
  7. }
  8.  
  9.  
  10. { ***********************************************************************
  11.   * This is example shows how to use p96AllocModeListTagList()
  12.   *
  13.   * tabt (Sat Dec 28 03:44:35 1996)
  14.   *********************************************************************** }
  15.  
  16. {$I "Include:exec/memory.i" }
  17. {$I "Include:exec/libraries.i" }
  18. {$I "Include:dos/RDArgs.i" }
  19. {$I "Include:libraries/dosextens.i" }
  20. {$I "Include:utils/stringlib.i" }
  21. {$I "Include:p96/Picasso96.i" }
  22.  
  23. Const
  24.     template    :   String  =   "Width=W/N,Height=H/N,Depth=D/N";
  25.     vecarray    :   Array[0..2] of Address = (Nil, Nil, Nil);
  26.  
  27. Var
  28.         ml          :   ListPtr;
  29.         width,
  30.         height,
  31.         depth       :   Integer;
  32.         rda         :   RDArgsPtr;
  33.         ptags       :   Array [0..32] Of TagItem;
  34.         mn          :   ^P96Mode;
  35.  
  36. Begin
  37.  P96Base:=OpenLibrary (P96Name,2);
  38.  IF P96Base<>NIL Then
  39.  Begin
  40.   width:=640;
  41.   height:=480;
  42.   depth:=8;
  43.  
  44.   rda:=ReadArgs (template,Adr(vecarray),Nil);
  45.   If rda<>Nil Then
  46.   Begin
  47.    If vecarray[0]<>NIL then CopyMem(vecarray[0],adr(width),4);
  48.    If vecarray[1]<>NIL then CopyMem(vecarray[1],adr(height),4);
  49.    If vecarray[2]<>NIL then CopyMem(vecarray[2],adr(depth),4);
  50.    FreeArgs(rda);
  51.   End;
  52.  
  53.   ptags[0].ti_Tag:=P96MA_MinWidth;
  54.   ptags[0].ti_Data:=width;
  55.   ptags[1].ti_Tag:=P96MA_MinHeight;
  56.   ptags[1].ti_Data:=height;
  57.   ptags[2].ti_Tag:=P96MA_MinDepth;
  58.   ptags[2].ti_Data:=depth;
  59.   ptags[3].ti_Tag:=TAG_DONE;
  60.   ml:=p96AllocModeListTagList (Adr(ptags));
  61.   If ml<>Nil Then
  62.   Begin
  63.    mn:=Address(ml^.lh_Head);
  64.    If mn<>Nil Then
  65.    Begin
  66.     While mn^.Node.ln_Succ<>Nil Do
  67.     Begin
  68.      Writeln (mn^.Description);
  69.      mn:=Address(mn^.Node.ln_Succ);
  70.     End;
  71.    End;
  72.    p96FreeModeList(ml);
  73.   End
  74.   Else
  75.    Writeln ("Unable to allocate list.");
  76.   CloseLibrary(P96Base);
  77.  End
  78.  Else
  79.   Writeln ("Unable to open Picasso96 library.");
  80. End.
  81.